﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

using CSF.BusinessCore.Service;
using CSF.Security.Data;

namespace CSF.Security.Service
{
    [ServiceContract]
    public interface IUserAccountSvc : IDataIdKeyService<UserAccount>, IDataEntityService<UserAccount>
    {
        [OperationContract]
        IEnumerable<int> GetUserRoles(int userId);

        [OperationContract]
        void SetUserRole(int userId, IEnumerable<int> roleIds, string createBy);

        /// <summary>
        /// 更新自己的账户信息
        /// </summary>
        /// <param name="account">账户对象实例</param>
        /// <returns>是否成功</returns>
        [OperationContract]
        bool UpdateBySelf(UserAccount account);

        /// <summary>
        /// 修改用户密码
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <param name="oldPassword">旧密码</param>
        /// <param name="newPassword">新密码</param>
        /// <returns></returns>
        [OperationContract]
        bool ChangePassword(int userId, string oldPassword, string newPassword, string changeBy);
     
    }
}
